package com.sxz.sbs.module.order.mode;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : tian
 * @date : 2018/04/18
 * @des : order之间传值
 */

public class IntentOrder implements Parcelable {
    private int orderId;
    private int parkingId;
    private int statusInt;
    private String isByStage;
    private String remark;
    private String price;
    private List<OrderDetailBean.PhotoList> photoList;
    private int spaceId;

    public int getSpaceId() {
        return spaceId;
    }

    public void setSpaceId(int spaceId) {
        this.spaceId = spaceId;
    }

    public List<OrderDetailBean.PhotoList> getPhotoList() {
        if (photoList == null) {
            return new ArrayList<>();
        }
        return photoList;
    }

    public void setPhotoList(List<OrderDetailBean.PhotoList> photoList) {
        this.photoList = photoList;
    }

    public String getIsByStage() {
        return isByStage == null ? "" : isByStage;
    }

    public void setIsByStage(String isByStage) {
        this.isByStage = isByStage;
    }

    public String getRemark() {
        return remark == null ? "" : remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getPrice() {
        return price == null ? "" : price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    public int getParkingId() {
        return parkingId;
    }

    public void setParkingId(int parkingId) {
        this.parkingId = parkingId;
    }

    public int getStatusInt() {
        return statusInt;
    }

    public void setStatusInt(int statusInt) {
        this.statusInt = statusInt;
    }

    public IntentOrder() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.orderId);
        dest.writeInt(this.parkingId);
        dest.writeInt(this.statusInt);
        dest.writeString(this.isByStage);
        dest.writeString(this.remark);
        dest.writeString(this.price);
        dest.writeList(this.photoList);
        dest.writeInt(this.spaceId);
    }

    protected IntentOrder(Parcel in) {
        this.orderId = in.readInt();
        this.parkingId = in.readInt();
        this.statusInt = in.readInt();
        this.isByStage = in.readString();
        this.remark = in.readString();
        this.price = in.readString();
        this.photoList = new ArrayList<OrderDetailBean.PhotoList>();
        in.readList(this.photoList, OrderDetailBean.PhotoList.class.getClassLoader());
        this.spaceId = in.readInt();
    }

    public static final Creator<IntentOrder> CREATOR = new Creator<IntentOrder>() {
        @Override
        public IntentOrder createFromParcel(Parcel source) {
            return new IntentOrder(source);
        }

        @Override
        public IntentOrder[] newArray(int size) {
            return new IntentOrder[size];
        }
    };
}
